package nl.janvanloenen.bkc;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;

public class StartFragment extends Fragment implements OnClickListener {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.start_fragment, null);
		ImageButton btn = (ImageButton) v.findViewById(R.id.btn2);
		ImageButton btn3 = (ImageButton) v.findViewById(R.id.btn3);
		ImageButton btn4 = (ImageButton) v.findViewById(R.id.btn4);
		ImageButton btn5 = (ImageButton) v.findViewById(R.id.btn5);
		btn.setOnClickListener(this);
		btn3.setOnClickListener(this);
		btn4.setOnClickListener(this);
		btn5.setOnClickListener(this);

		return v;

	}

	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn1:
			// Button one is handled in MainActivity
			return;
		case R.id.btn2:
			// Create a new Match
			Intent openNewMatch = new Intent("nl.janvanloenen.bkc.NewMatch");
			startActivity(openNewMatch);
			System.out.println("test");
			return;
		case R.id.btn3:
			// ?
			return;
		case R.id.btn4:
			// ?
			return;
		case R.id.btn5:
			// ?
			return;
		case R.id.btn6:
			// Button six is handled in MainActivity
			return;
		}
	}

}
